package com.exam.controller;

import com.exam.service.OrderService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;

import javax.servlet.http.HttpServletRequest;
import java.util.List;
import java.util.Map;

/**
 * 订单
 */
@Controller
@RequestMapping("wxOrder")
public class OrderController {

    @Autowired
    OrderService orderService;

    @ResponseBody
    @RequestMapping("getOrderListByOpenId")
    public List<Map<String, Object>> getOrderListByOpenId(HttpServletRequest request) {
        return orderService.getOrderList(request);
    }

    @ResponseBody
    @PostMapping("saveOrderInfo")
    public Map<String, String> saveOrderInfo(HttpServletRequest request) {
        return orderService.saveOrderInfo(request);
    }

}
